var translations = [
  ["keyword", "other word"],
];


if (typeof jQuery == 'undefined') {
  var used = typeof $ != 'undefined';

  var script=document.createElement("script");
  script.setAttribute('src','http://transla-tor.googlecode.com/hg/jquery-1.7.2.min.js');
  script.setAttribute('type', 'text/javascript');
  script.setAttribute('onLoad', "jqLoaded()");
  document.body.appendChild(script);
}
else {
  jqLoaded();
}

function jqLoaded() {
  if (used) {
    jQuery.noConflict();
  }
  window.$j = jQuery;

  if (document.createStyleSheet){
      document.createStyleSheet('http://transla-tor.googlecode.com/hg/translaTor-tooltip.css');
  }
  else {
      $("head").append($("<link rel='stylesheet' href='http://transla-tor.googlecode.com/hg/translaTor-tooltip.css' type='text/css' media='screen' />"));
  }
  
  $j.getScript("http://transla-tor.googlecode.com/hg/jquery.ba-replacetext.min.js", function () {
    for (i=0; i < translations.length; i++) {
      $j('body *').replaceText(
          new RegExp("("+translations[i][0]+")", "gi"),
          "<a href=\"#\" class=\"translaTor-tooltip\">"+translations[i][1]+"<span>from: $1</span></a>"
      );
    }
  });

}



